INSERT INTO  TRASPARENZA
 select 'T37',CODICE_BOLLETTA AS BOLLETTA,'','TOTALE BOLLETTA','' AS DAL,'' AS AL
,0 AS GIORNI,0 SCAGLIONE,0 FASCIA,
0 CORR_UNIT,0 AS QUANTITA,
IMPORTO_COMPETENZA_TOTALE
 AS TOTALE,'' ALI_IVA,null


FROM DB5.COMPETENZE@pgu3,
    (   SELECT DISTINCT CODICE_BOLLETTA FROM UT_UE.TMPMARKI@asmdw
    ) A
WHERE
DB5.COMPETENZE.CODICE_COMPETENZA = A.CODICE_BOLLETTA
AND DB5.COMPETENZE.CODICE_GESTIONE ='UNRG'
AND DB5.COMPETENZE.CODICE_ORIGINE_COMPETENZA='B'
--and COMPETENZE.CODICE_COMPETENZA = 7161159